# -*- coding: utf-8 -*-
import os
import sys

# Configure
BASE_DIR = os.path.dirname(__file__)
CONFIG_DIR = os.path.join(BASE_DIR, "config")

# Load env
os.environ["CONTRACT_MARKET_ENV"] = os.path.dirname(CONFIG_DIR)

# Add env
sys.path.insert(0, os.environ["CONTRACT_MARKET_ENV"])

# REDIS
# REDIS_HOST = "47.242.119.59"
REDIS_HOST = "127.0.0.1"
REDIS_PORT = "7006"
# REDIS_PORT = "6379"
REDIS_PASSWORD = ""
REDIS_DB = 0

# RPC
# RPC_HOST = "47.242.119.59"
# RPC_PORT = "8989"
RPC_HOST = "127.0.0.1"
RPC_PORT = "9898"
RPC_DOMAIN = RPC_HOST + ":" + RPC_PORT
RPC_TIMEOUT = 10
RPC_OPTION = [
    ('grpc.keepalive_timeout_ms', 10000),
    # ('rpc.enable_retries', 0),
    ('grpc.http2.write_buffer_size', 10),
    # ('grpc.http2.lookahead_bytes', 4*1024*1024),
]

# ZMQ
ZMQ_HOST = "47.242.119.59"
ZMQ_PORT = "5555"

# grpc.max_send_message_length 
# grpc.enable_retries 0
# grpc.http2.write_buffer_size 100
# grpc.http2.lookahead_bytes 并且此参数将变为no-op